package two;

public class 二六类型转换 {
    public static void main(String[] args) {
        /**
         * 自动类型转换
         * byte -> short
         * short -> int
         * char -> int
         * int -> long
         * int -> double
         * float -> double
         * 丢失精度
         * int -> float
         * long -> float
         * long -> double
         */

        /**
         * 强制类型转换
         */
        double x  = 3.14;
        int nx = (int)x;   //值为3
        char c = 'a';
        int d = c+1;
        System.out.println(nx);
        System.out.println(d);
        System.out.println((char)d);
    }
}
